package model.validation;

import model.Square;

public class SquareValidator implements ShapeValidator<Square> {

    public static final String SQUARE_DIMENSION_NEGATIVE = "SQUARE_DIMENSION_NEGATIVE";

    @Override
    public void validate(Square entity) {
        if (entity.getA() < 0) {
            throw new ShapeValidationException(SQUARE_DIMENSION_NEGATIVE);
        }
    }
}
